/*
 * 作者:熊猫
 * 日期:2017 - 3 - 15 4 - 34 - 1
 *
 */

package net.lainiao.morethread.Chapter6.demo7;

/**
 * Created by Administrator on 2017/3/15.
 */
public class Main {
    public static void main(String[] args) {
        Account account=new Account();
        account.setBalance(11111111);
        Company company=new Company(account);
        Bank bank=new Bank(account);
        Thread companyThread=new Thread(company);
        Thread bankThread=new Thread(bank);
        companyThread.start();
        bankThread.start();
        try {
            companyThread.join();
            bankThread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Main : End of Balance for :"+account.getBalance());
        System.out.println("Main Over");
    }
}
